package demo2;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 98152
 * Date: 2024-06-04
 * Time: 16:07
 */
public class Test {
    public static void main(String[] args) throws CloneNotSupportedException{
        Person person1 = new Person("zhangsan",10);
        Person person2 = (Person)person1.clone();
        System.out.println("修改前person1: " + person1);
        System.out.println("修改前person2: " + person2);
        person2.m.money = 99.99;
        System.out.println("修改后person1: " + person1);
        System.out.println("修改后person2: " + person2);
        person1.m.money = 999.99;
        System.out.println("修改后person1: " + person1);
        System.out.println("修改后person2: " + person2);
    }
}
